home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
nroff~06.zoo
/
makefile
< prev
next >
Wrap
Makefile
|
1992-09-11
|
9KB
|
394 lines
# note this version of makefile fixes a few glitches and adds gversion...
FIXSTK=fixstk 64K
GVERSION=gversion -v 1.2.1
#----------------------------------------------------------------------------
# makefile for nroff 07/15/92 wjr. this makefile _SHOULD_ handle minix, tos,
# and unix. PLEASE READ THE ENTIRE MAKEFILE BEFORE YOU MAKE! this is the GNU
# C version.
#
# this makefile was designed for my own make(1) and may not work correctly
# with minix. but then i don't have to worry about 64k limits so it can be
# more robust. it should work with any reasonable make, though. nothing fancy
# here...
#
# please look at the makefile first to customize it to your environment.
#----------------------------------------------------------------------------
# $Id: makefile.,v 1.2 1992/07/16 11:56:10 rosenkra Exp $
#
# $Log: makefile.,v $
# Revision 1.2 1992/07/16 11:56:10 rosenkra
# port to gcc
#
#----------------------------------------------------------------------------
#
# MACRO DEFINITIONS:
#
# version (3 digits max):
#
VER = 120
# compiler:
#
CC = gcc -v -z -Wall -Ig:/mint/include
LD = gcc -v -z -Wall -Lg:/mint/lib
# rename:
#
RENAME = cp -p
#RENAME = entab
# install:
#
INSTALL = cp -p
#
# main target:
#
# for tos, make this ".ttp", otherwise blank
#
EXTN = .ttp
# for testing, use "x", otherwise blank
#
XTST = x
TARGET = $(XTST)nroff$(EXTN)
# manual page names:
#
# section of the manual (generally always "1")
#
SECTN = 1
MANSRC = nroff.man
CATPAGE = nroff.cat
MANPAGE = nroff.$(SECTN)
SECTN_an = 7
MANSRC_an = man.man
CATPAGE_an = man.cat
MANPAGE_an = man.$(SECTN_an)
SECTN_s = 7
MANSRC_s = ms.man
CATPAGE_s = ms.cat
MANPAGE_s = ms.$(SECTN_s)
# compile flags:
#
# for different versions, use only one of the following sets in VERSFLAGS:
# tos: -Dtos -Dalcyon
# minix ST: -Dminix -DatariST
# minix PC: -Dminix
# unix: -Dunix
#
# DEBUG can be "-g" under unix and OPTIMIZE can be "-O"
# note that minix may need other flags as well (i don't have minix)
#
ARCH = -mshort
VERSFLAGS = -Dtos #-Dalcyon
DEFS = -DUSE_STDIN -UUSE_PROTOTYPES -DNO_CR -DDO_HYPH
DEBUG = #-g
OPTIMIZE = -O -fomit-frame-pointer
PROF = #-pg
CFLAGS = $(ARCH) $(DEFS) $(VERSFLAGS) $(DEBUG) $(OPTIMIZE)
# link flags:
#
# for alcyon/tos, i use "-s -stksiz" for SYMB, others may vary
#
SYMB =
LDOPT = -nostdlib g:/mint/lib/crt0.o
LDFLAGS = $(SYMB) $(ARCH) $(DEBUG) $(PROF) $(LDOPT)
# source files:
#
HEADERS = config.h nroff.h version.h
SRCS1 = main.c command.c text.c io.c
SRCS2 = macros.c strings.c escape.c low.c dev.c hyph.c
SRCS = $(SRCS1) $(SRCS2)
# object targets:
#
# for normal systems (i.e. sun,apollo,hp,ibm,cray,etc): O=o
# for minix (ACK is right!): O=s (SHEESH!!!)
O =o
OBJS = main.$O command.$O text.$O io.$O macros.$O strings.$O \
escape.$O low.$O dev.$O hyph.$O
# other files in the distribution:
#
TESTS = test.0
OTHERS = README MANIFEST Makefile nroff.man man.man ms.man \
tmac.an tmac.s $(TESTS)
# linked libraries:
#
# for alcyon/tos, i use "-lc"
#
#LIBS = -ltermcap16 -lgnu16
LIBS = -lgnu16
# arc archive:
#
ARCFILE = nroff$(VER).arc
# executable uuencoded:
#
UUEFILE = nroff$(VER).uue
# shar files:
#
SHARFLG = -a
SHARF1 = nroff$(VER).01
SHARF2 = nroff$(VER).02
SHARF3 = nroff$(VER).03
SHARF4 = nroff$(VER).04
SHARF5 = nroff$(VER).05
SHARFILE = nroff$(VER).shr
# macro library files:
#
MAN_MACRO = tmac.an
MS_MACRO = tmac.s
#ME_MACRO = tmac.e
# final locations for things:
#
# set these as per your system (for "make install")
# tos: TMACDIR = c:\lib\tmac (for tmac.an)
# BINDIR = c:\bin (for nroff)
# MANDIR = c:\man\man$(SECTN) (for nroff.1)
# minix: TMACDIR = /usr/lib/tmac
# BINDIR = /usr/bin
# MANDIR = /usr/man/man$(SECTN)
# unix: TMACDIR = /usr/local/lib/tmac
# BINDIR = /usr/local/bin
# MANDIR = /usr/local/man/man$(SECTN)
#
TMACDIR = c:\lib\tmac
BINDIR = c:\bin
MANDIR = d:\usr\man\man$(SECTN)
MANDIR_an = d:\usr\man\man$(SECTN_an)
MANDIR_s = d:\usr\man\man$(SECTN_s)
# system path seperator:
#
# note that my make under tos uses <space>\ for line continuation so i can't
# put a space after the "=".
# for tos, use: S=\ (NO SPACES!!!)
# for minix, unix, use: S=/
#
S =/
# testing:
#
# make sure to "setenv TMACDIR ." first...
#
RUNPARM = -man test.0
RUNOUT = >test.out
# a non-objecting rm command:
#
# unix/minix: RM = rm -f
RM = rm -f
.SUFFIXES: .man .cat
.man.cat:
nroff -manx -T -rO1 $< >$@
#----------------------------------------------------------------------------
#
# ACTIONS:
#
# directions for making things is default target...
#
directions:
@echo Please read the README file first. Also review makefile.
@echo Type "make all" to build $(TARGET)
@echo Type "make manpage" to build $(MANPAGE)
@echo Type "make install" to build/install $(TARGET)
@echo Type "make test" to test $(TARGET)
@echo Type "make clean" to remove objects
@echo Type "make clobber" to remove objects and $(TARGET)
@echo Type "make arc" to make source archive $(ARCFILE)
@echo Type "make shar" to make source shar file $(SHARFILE)
@echo Type "make uue" to make uuencoded $(TARGET) $(UUEFILE)
# make main target...
#
all: $(TARGET)
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
$(GVERSION) $(TARGET)
$(FIXSTK) $(TARGET)
@echo "done making $(TARGET)"
# make installable manpage...
#
# you may have to change this. i keep my manpages pre-nroffed so i use
# CATPAGE as my manpage. your man(1) may use nroff to display manpages,
# so you may want to do this instead:
#
# manpage: $(MANPAGE) $(MANPAGE_an)
#
# $(MANPAGE): $(MANSRC)
# $(RENAME) $(MANSRC) $(MANPAGE)
#
# $(MANPAGE_an): $(MANSRC_an)
# $(RENAME) $(MANSRC_an) $(MANPAGE_an)
#
manpage: $(MANPAGE) $(MANPAGE_an) $(MANPAGE_s)
@echo "done making manpages"
$(MANPAGE): $(CATPAGE)
$(RENAME) $(CATPAGE) $(MANPAGE)
$(MANPAGE_an): $(CATPAGE_an)
$(RENAME) $(CATPAGE_an) $(MANPAGE_an)
$(MANPAGE_s): $(CATPAGE_s)
$(RENAME) $(CATPAGE_s) $(MANPAGE_s)
$(CATPAGE): $(MANSRC) # use built-in .man.cat rule
$(CATPAGE_an): $(MANSRC_an)
$(CATPAGE_s): $(MANSRC_s)
# to test run it...
#
test: $(TARGET)
$(TARGET) $(RUNPARM) $(RUNOUT)
@echo "done with test"
# install target, manpage, and lib stuff...
#
install: install_bin install_man install_tmac
@echo "install complete"
install_bin: $(TARGET)
$(INSTALL) $(TARGET) $(BINDIR)$S$(TARGET)
@echo "done installing $(TARGET)"
install_man: $(MANPAGE) $(MANPAGE_an) $(MANPAGE_s)
$(INSTALL) $(MANPAGE) $(MANDIR)$S$(MANPAGE)
$(INSTALL) $(MANPAGE_an) $(MANDIR_an)$S$(MANPAGE_an)
$(INSTALL) $(MANPAGE_s) $(MANDIR_s)$S$(MANPAGE_s)
@echo "done installing manpages"
install_tmac:
$(INSTALL) $(MAN_MACRO) $(TMACDIR)$S$(MAN_MACRO)
$(INSTALL) $(MS_MACRO) $(TMACDIR)$S$(MS_MACRO)
# $(INSTALL) $(ME_MACRO) $(TMACDIR)$S$(ME_MACRO)
@echo "done installing macro packages"
# clean up...
#
clean:
$(RM) $(OBJS) errs
clobber:
$(RM) $(OBJS)
$(RM) $(TARGET)
cleansrc:
$(RM) $(SRCS) $(HEADERS)
cleandocs:
$(RM) docs.arc readme bugs $(MANPAGE) $(MAN_MACRO) $(MS_MACRO)
# various archives...
#
uue:
$(UUENCODE) $(TARGET)
@echo done making $(UUEFILE)
shar: uue
$(SHAR) $(SHARFLG) $(OTHERS) >$(SHARF1)
$(SHAR) $(SHARFLG) $(SRCS1) >$(SHARF2)
$(SHAR) $(SHARFLG) $(SRCS2) >$(SHARF3)
$(SHAR) $(SHARFLG) $(HEADERS) >$(SHARF4)
$(SHAR) $(SHARFLG) $(UUEFILE) >$(SHARF5)
@echo done making $(SHARF1) $(SHARF2) $(SHARF3) $(SHARF4) $(SHARF5)
arc:
$(ARC) a $(ARCFILE) $(OTHERS)
$(ARC) a $(ARCFILE) $(HEADERS)
$(ARC) a $(ARCFILE) $(SRCS)
@echo done making $(ARCFILE)
# the following actions i use while developing so i can save disk space.
# use this to save space on disk
#
backup: objs.arc srcs.arc docs.arc
objs.arc:
$(ARC) a objs.arc $(OBJS) $(TARGET)
@echo done making objs.arc. consider "make clean"
srcs.arc:
$(ARC) a srcs.